/*
 * GeoManager.h
 *
 *  Created on: 14 Oct 2011
 *      Author: allan
 */

#ifndef GEOMANAGER_H_
#define GEOMANAGER_H_

// C++ includes
#include <map>
#include <string>
#include <vector>
using namespace std;

// GeoReact includes
#include <Core/Activity.h>
#include <Geochemistry/Kinetics/MineralKinetics/MineralKinetics.h>

// GeoReact forward declarations
class Multiphase;
class ReactionSystem;
class GeoEquilibrator;
class GeoReactor;
class GeoSystem;

class GeoManager
{
public:
	GeoManager();
	
	void
	SetAqueousSpecies(const vector<string>& aqueous_species);
	
	void
	SetGaseousSpecies(const vector<string>& gaseous_species);
	
	void
	SetMineralSpecies(const vector<string>& mineral_species);
	
	void
	RegisterKinetics(const MineralKineticsInfo& mineral_kinetics_info);
	
	const vector<string>
	GetAqueousSpecies() const;
	
	const vector<string>
	GetGaseousSpecies() const;
	
	const vector<string>
	GetMineralSpecies() const;
	
	const GeoSystem
	CreateGeoSystem() const;
	
	const GeoEquilibrator
	CreateGeoEquilibrator() const;
	
	const GeoReactor
	CreateGeoReactor() const;
	
	operator GeoSystem() const;
	operator GeoEquilibrator() const;
	operator GeoReactor() const;
	
private:
	vector<string> aqueous_species;
	
	vector<string> gaseous_species;
	
	vector<string> mineral_species;
	
	map<string, MineralKineticsInfo> mineral_kinetics_infos;
	
	vector<string> kinetic_species;
	
private:
	const Reaction
	CreateReaction(const string& reactant, const Multiphase& multiphase) const;

	const Phase
	CreateAqueousPhase(const vector<string>& species) const;
	
	const Phase
	CreateGaseousPhase(const vector<string>& species) const;
	
	const Phase
	CreateMineralPhase(const vector<string>& species) const;
	
	const Multiphase
	CreateMultiphase() const;
	
	const ReactionSystem
	CreateEquilibriumReactions(const Multiphase& multiphase) const;
	
	const ReactionSystem
	CreateKineticReactions(const Multiphase& multiphase) const;
};

#endif /* GEOMANAGER_H_ */
